package com.hustcad.plm.rpm.model.entity.admin;

import com.hustcad.plm.pdm.core.anno.DataCommon;
import com.hustcad.plm.pdm.core.api.common.HasName;
import com.hustcad.plm.pdm.core.base.EntityBase;
import com.hustcad.plm.rpm.general.api.own.HasCreator;
import com.hustcad.plm.rpm.model.dto.admin.TyppmProjectDTO;
import com.hustcad.plm.rpm.model.dto.team.TyppmTeamTreeDTO;
import com.hustcad.plm.rpm.model.dto.user.TyppmUserQueryDTO;
import com.hustcad.plm.rpm.model.entity.plan.TyppmPlan;
import com.hustcad.plm.rpm.model.entity.plan.TyppmPlanActive;
import com.hustcad.plm.rpm.model.entity.resource.TyppmPlanResource;
import io.swagger.annotations.ApiModel;
import java.time.LocalDateTime;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;

import lombok.AllArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.springframework.context.annotation.Primary;

@ApiModel(
    value = "项目模板",
    description = ""
)
@Primary
@AllArgsConstructor
public class TyppmProjectTemplate extends EntityBase implements HasName, HasCreator {
    public static final String TY_CLASSNAME = "ty.projectmng.admin.CTyProjectTemplate";
    public static final String TY_CLASSDESC = "项目模板";
    private static final long serialVersionUID = -5393346482530930395L;
    @Column(
        name = "projectoid",
        length = 64
    )
    @DataCommon("项目")
    private String projectOID;
    @Column(
        name = "projectotype",
        length = 128
    )
    @DataCommon("项目")
    private String projectOTYPE;
    @Transient
    private String projectName;
    @Column(
        name = "name",
        length = 2000
    )
    @DataCommon("名称")
    private @NotBlank(
    message = "PARAMS_NOT_EMPTY"
) @Length(
    max = 200,
    message = "名称最长可输入200字符"
) String name;
    @Column(
        name = "creatoroid",
        length = 56
    )
    private String creatorOID = null;
    @Column(
        name = "creatorotype",
        length = 160
    )
    private String creatorOTYPE;
    @Transient
    private String creatorName;
    @Transient
    private String creatorDescription;
    @Transient
    private TyppmProject project;
    @Transient
    private TyppmPlan plan;
    @Transient
    private List<TyppmPlanActive> planActiveList;
    @Transient
    private List<TyppmUserQueryDTO> projectManagerList;
    @Transient
    private List<TyppmTeamTreeDTO> projectTeamList;
    @Transient
    private List<TyppmPlanResource> planResourceList;
    @Transient
    private LocalDateTime startDate;
    @Transient
    private LocalDateTime finishDate;
    @Transient
    private TyppmProjectDTO newProject;
    @Transient
    private Boolean projectFlag = false;
    @Column(
        name = "istemplate"
    )
    @DataCommon("模板类型:0(非模板),1(项目模板),2(计划模板),3(活动模板),4(团队模板),5(资源模板)")
    public Integer isTemplate;
    @Column(
        name = "extprops",
        length = 4000
    )
    @DataCommon("扩展属性")
    public String extProps;


    private String developmentLevel;
    private String developmentMode;
    private String pushMode;

    public String getDevelopmentLevel() {
        return developmentLevel;
    }

    public void setDevelopmentLevel(String developmentLevel) {
        this.developmentLevel = developmentLevel;
    }

    public String getDevelopmentMode() {
        return developmentMode;
    }

    public void setDevelopmentMode(String developmentMode) {
        this.developmentMode = developmentMode;
    }

    public String getPushMode() {
        return pushMode;
    }

    public void setPushMode(String pushMode) {
        this.pushMode = pushMode;
    }

    public TyppmProjectTemplate() {
        this.setOtype("ty.projectmng.admin.CTyProjectTemplate");
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof TyppmProjectTemplate)) {
            return false;
        } else {
            TyppmProjectTemplate other = (TyppmProjectTemplate)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label251: {
                    Object this$projectFlag = this.getProjectFlag();
                    Object other$projectFlag = other.getProjectFlag();
                    if (this$projectFlag == null) {
                        if (other$projectFlag == null) {
                            break label251;
                        }
                    } else if (this$projectFlag.equals(other$projectFlag)) {
                        break label251;
                    }

                    return false;
                }

                Object this$isTemplate = this.getIsTemplate();
                Object other$isTemplate = other.getIsTemplate();
                if (this$isTemplate == null) {
                    if (other$isTemplate != null) {
                        return false;
                    }
                } else if (!this$isTemplate.equals(other$isTemplate)) {
                    return false;
                }

                Object this$projectOID = this.getProjectOID();
                Object other$projectOID = other.getProjectOID();
                if (this$projectOID == null) {
                    if (other$projectOID != null) {
                        return false;
                    }
                } else if (!this$projectOID.equals(other$projectOID)) {
                    return false;
                }

                label230: {
                    Object this$projectOTYPE = this.getProjectOTYPE();
                    Object other$projectOTYPE = other.getProjectOTYPE();
                    if (this$projectOTYPE == null) {
                        if (other$projectOTYPE == null) {
                            break label230;
                        }
                    } else if (this$projectOTYPE.equals(other$projectOTYPE)) {
                        break label230;
                    }

                    return false;
                }

                label223: {
                    Object this$projectName = this.getProjectName();
                    Object other$projectName = other.getProjectName();
                    if (this$projectName == null) {
                        if (other$projectName == null) {
                            break label223;
                        }
                    } else if (this$projectName.equals(other$projectName)) {
                        break label223;
                    }

                    return false;
                }

                label216: {
                    Object this$name = this.getName();
                    Object other$name = other.getName();
                    if (this$name == null) {
                        if (other$name == null) {
                            break label216;
                        }
                    } else if (this$name.equals(other$name)) {
                        break label216;
                    }

                    return false;
                }

                Object this$creatorOID = this.getCreatorOID();
                Object other$creatorOID = other.getCreatorOID();
                if (this$creatorOID == null) {
                    if (other$creatorOID != null) {
                        return false;
                    }
                } else if (!this$creatorOID.equals(other$creatorOID)) {
                    return false;
                }

                label202: {
                    Object this$creatorOTYPE = this.getCreatorOTYPE();
                    Object other$creatorOTYPE = other.getCreatorOTYPE();
                    if (this$creatorOTYPE == null) {
                        if (other$creatorOTYPE == null) {
                            break label202;
                        }
                    } else if (this$creatorOTYPE.equals(other$creatorOTYPE)) {
                        break label202;
                    }

                    return false;
                }

                Object this$creatorName = this.getCreatorName();
                Object other$creatorName = other.getCreatorName();
                if (this$creatorName == null) {
                    if (other$creatorName != null) {
                        return false;
                    }
                } else if (!this$creatorName.equals(other$creatorName)) {
                    return false;
                }

                label188: {
                    Object this$creatorDescription = this.getCreatorDescription();
                    Object other$creatorDescription = other.getCreatorDescription();
                    if (this$creatorDescription == null) {
                        if (other$creatorDescription == null) {
                            break label188;
                        }
                    } else if (this$creatorDescription.equals(other$creatorDescription)) {
                        break label188;
                    }

                    return false;
                }

                Object this$project = this.getProject();
                Object other$project = other.getProject();
                if (this$project == null) {
                    if (other$project != null) {
                        return false;
                    }
                } else if (!this$project.equals(other$project)) {
                    return false;
                }

                Object this$plan = this.getPlan();
                Object other$plan = other.getPlan();
                if (this$plan == null) {
                    if (other$plan != null) {
                        return false;
                    }
                } else if (!this$plan.equals(other$plan)) {
                    return false;
                }

                label167: {
                    Object this$planActiveList = this.getPlanActiveList();
                    Object other$planActiveList = other.getPlanActiveList();
                    if (this$planActiveList == null) {
                        if (other$planActiveList == null) {
                            break label167;
                        }
                    } else if (this$planActiveList.equals(other$planActiveList)) {
                        break label167;
                    }

                    return false;
                }

                label160: {
                    Object this$projectManagerList = this.getProjectManagerList();
                    Object other$projectManagerList = other.getProjectManagerList();
                    if (this$projectManagerList == null) {
                        if (other$projectManagerList == null) {
                            break label160;
                        }
                    } else if (this$projectManagerList.equals(other$projectManagerList)) {
                        break label160;
                    }

                    return false;
                }

                Object this$projectTeamList = this.getProjectTeamList();
                Object other$projectTeamList = other.getProjectTeamList();
                if (this$projectTeamList == null) {
                    if (other$projectTeamList != null) {
                        return false;
                    }
                } else if (!this$projectTeamList.equals(other$projectTeamList)) {
                    return false;
                }

                Object this$planResourceList = this.getPlanResourceList();
                Object other$planResourceList = other.getPlanResourceList();
                if (this$planResourceList == null) {
                    if (other$planResourceList != null) {
                        return false;
                    }
                } else if (!this$planResourceList.equals(other$planResourceList)) {
                    return false;
                }

                label139: {
                    Object this$startDate = this.getStartDate();
                    Object other$startDate = other.getStartDate();
                    if (this$startDate == null) {
                        if (other$startDate == null) {
                            break label139;
                        }
                    } else if (this$startDate.equals(other$startDate)) {
                        break label139;
                    }

                    return false;
                }

                Object this$finishDate = this.getFinishDate();
                Object other$finishDate = other.getFinishDate();
                if (this$finishDate == null) {
                    if (other$finishDate != null) {
                        return false;
                    }
                } else if (!this$finishDate.equals(other$finishDate)) {
                    return false;
                }

                Object this$newProject = this.getNewProject();
                Object other$newProject = other.getNewProject();
                if (this$newProject == null) {
                    if (other$newProject != null) {
                        return false;
                    }
                } else if (!this$newProject.equals(other$newProject)) {
                    return false;
                }

                Object this$extProps = this.getExtProps();
                Object other$extProps = other.getExtProps();
                if (this$extProps == null) {
                    if (other$extProps != null) {
                        return false;
                    }
                } else if (!this$extProps.equals(other$extProps)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof TyppmProjectTemplate;
    }

    public int hashCode() {
        int result = 1;
        Object $projectFlag = this.getProjectFlag();
        result = result * 59 + ($projectFlag == null ? 43 : $projectFlag.hashCode());
        Object $isTemplate = this.getIsTemplate();
        result = result * 59 + ($isTemplate == null ? 43 : $isTemplate.hashCode());
        Object $projectOID = this.getProjectOID();
        result = result * 59 + ($projectOID == null ? 43 : $projectOID.hashCode());
        Object $projectOTYPE = this.getProjectOTYPE();
        result = result * 59 + ($projectOTYPE == null ? 43 : $projectOTYPE.hashCode());
        Object $projectName = this.getProjectName();
        result = result * 59 + ($projectName == null ? 43 : $projectName.hashCode());
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        Object $creatorOID = this.getCreatorOID();
        result = result * 59 + ($creatorOID == null ? 43 : $creatorOID.hashCode());
        Object $creatorOTYPE = this.getCreatorOTYPE();
        result = result * 59 + ($creatorOTYPE == null ? 43 : $creatorOTYPE.hashCode());
        Object $creatorName = this.getCreatorName();
        result = result * 59 + ($creatorName == null ? 43 : $creatorName.hashCode());
        Object $creatorDescription = this.getCreatorDescription();
        result = result * 59 + ($creatorDescription == null ? 43 : $creatorDescription.hashCode());
        Object $project = this.getProject();
        result = result * 59 + ($project == null ? 43 : $project.hashCode());
        Object $plan = this.getPlan();
        result = result * 59 + ($plan == null ? 43 : $plan.hashCode());
        Object $planActiveList = this.getPlanActiveList();
        result = result * 59 + ($planActiveList == null ? 43 : $planActiveList.hashCode());
        Object $projectManagerList = this.getProjectManagerList();
        result = result * 59 + ($projectManagerList == null ? 43 : $projectManagerList.hashCode());
        Object $projectTeamList = this.getProjectTeamList();
        result = result * 59 + ($projectTeamList == null ? 43 : $projectTeamList.hashCode());
        Object $planResourceList = this.getPlanResourceList();
        result = result * 59 + ($planResourceList == null ? 43 : $planResourceList.hashCode());
        Object $startDate = this.getStartDate();
        result = result * 59 + ($startDate == null ? 43 : $startDate.hashCode());
        Object $finishDate = this.getFinishDate();
        result = result * 59 + ($finishDate == null ? 43 : $finishDate.hashCode());
        Object $newProject = this.getNewProject();
        result = result * 59 + ($newProject == null ? 43 : $newProject.hashCode());
        Object $extProps = this.getExtProps();
        result = result * 59 + ($extProps == null ? 43 : $extProps.hashCode());
        return result;
    }

    public String getProjectOID() {
        return this.projectOID;
    }

    public void setProjectOID(final String projectOID) {
        this.projectOID = projectOID;
    }

    public String getProjectOTYPE() {
        return this.projectOTYPE;
    }

    public void setProjectOTYPE(final String projectOTYPE) {
        this.projectOTYPE = projectOTYPE;
    }

    public String getProjectName() {
        return this.projectName;
    }

    public void setProjectName(final String projectName) {
        this.projectName = projectName;
    }

    public String getName() {
        return this.name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public String getCreatorOID() {
        return this.creatorOID;
    }

    public void setCreatorOID(final String creatorOID) {
        this.creatorOID = creatorOID;
    }

    public String getCreatorOTYPE() {
        return this.creatorOTYPE;
    }

    public void setCreatorOTYPE(final String creatorOTYPE) {
        this.creatorOTYPE = creatorOTYPE;
    }

    public String getCreatorName() {
        return this.creatorName;
    }

    public void setCreatorName(final String creatorName) {
        this.creatorName = creatorName;
    }

    public String getCreatorDescription() {
        return this.creatorDescription;
    }

    public void setCreatorDescription(final String creatorDescription) {
        this.creatorDescription = creatorDescription;
    }

    public TyppmProject getProject() {
        return this.project;
    }

    public void setProject(final TyppmProject project) {
        this.project = project;
    }

    public TyppmPlan getPlan() {
        return this.plan;
    }

    public void setPlan(final TyppmPlan plan) {
        this.plan = plan;
    }

    public List<TyppmPlanActive> getPlanActiveList() {
        return this.planActiveList;
    }

    public void setPlanActiveList(final List<TyppmPlanActive> planActiveList) {
        this.planActiveList = planActiveList;
    }

    public List<TyppmUserQueryDTO> getProjectManagerList() {
        return this.projectManagerList;
    }

    public void setProjectManagerList(final List<TyppmUserQueryDTO> projectManagerList) {
        this.projectManagerList = projectManagerList;
    }

    public List<TyppmTeamTreeDTO> getProjectTeamList() {
        return this.projectTeamList;
    }

    public void setProjectTeamList(final List<TyppmTeamTreeDTO> projectTeamList) {
        this.projectTeamList = projectTeamList;
    }

    public List<TyppmPlanResource> getPlanResourceList() {
        return this.planResourceList;
    }

    public void setPlanResourceList(final List<TyppmPlanResource> planResourceList) {
        this.planResourceList = planResourceList;
    }

    public LocalDateTime getStartDate() {
        return this.startDate;
    }

    public void setStartDate(final LocalDateTime startDate) {
        this.startDate = startDate;
    }

    public LocalDateTime getFinishDate() {
        return this.finishDate;
    }

    public void setFinishDate(final LocalDateTime finishDate) {
        this.finishDate = finishDate;
    }

    public TyppmProjectDTO getNewProject() {
        return this.newProject;
    }

    public void setNewProject(final TyppmProjectDTO newProject) {
        this.newProject = newProject;
    }

    public Boolean getProjectFlag() {
        return this.projectFlag;
    }

    public void setProjectFlag(final Boolean projectFlag) {
        this.projectFlag = projectFlag;
    }

    public Integer getIsTemplate() {
        return this.isTemplate;
    }

    public void setIsTemplate(final Integer isTemplate) {
        this.isTemplate = isTemplate;
    }

    public String getExtProps() {
        return this.extProps;
    }

    public void setExtProps(final String extProps) {
        this.extProps = extProps;
    }
}
